package zn.io.fastframe.modules.sys.controller;

import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import zn.io.fastframe.modules.sys.entity.SysUserEntity;

public abstract class AbstractController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 返回user
     * @return
     */
    protected SysUserEntity getUser() {
        return (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
    }

    /**
     * 返回userId
     * @return
     */
    protected Long getUserId() {
        return this.getUser().getUserId();
    }
}
